package br.infotec.musicaunb.domain;


import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.search.annotations.DocumentId;
import org.springframework.data.jpa.domain.AbstractPersistable;
/**
 * entidade representando um professor
 * @author eduardo
 * 
 * @author Denis
 * 		Relacinamentos
 * 		serialVersion
 *
 */
@Entity
@Table(name="professor")
public class Professor extends AbstractPersistable<Integer> implements AbstraticPojo{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// atributos relacinais
	private Login login;
	private Endereco endereco;
	// atributos originais	
	private String nome;
	private String email;
	private String rg;
	private String matriculaUnb;
	// atributos herdados
	private List<Turma> turmas;
	private List<Telefone> telefones;
	
	@Override
	@DocumentId
	@GeneratedValue
	@Column(name="id_professor")
	public Integer getId() {
		return super.getId();
	}
	
	@Column	
	public String getNome() {
		return nome;
	}
	
	public void setNome(String nome) {
		this.nome = nome;
	}
	
	@Column	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Column	
	public String getRg() {
		return rg;
	}
	public void setRg(String rg) {
		this.rg = rg;
	}
	
	@Column(name="matricula_unb")
	public String getMatriculaUnb() {
		return matriculaUnb;
	}
	public void setMatriculaUnb(String matriculaUnb) {
		this.matriculaUnb = matriculaUnb;
	}
	
	@ManyToOne
	@JoinColumn(name = "id_login")
	public Login getLogin() {
		return login;
	}
	public void setLogin(Login login) {
		this.login = login;
	}
	
	@OneToOne
	public Endereco getEndereco() {
		return endereco;
	}
	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}
	
	@OneToMany(mappedBy = "professor")
	public List<Turma> getTurmas() {
		return turmas;
	}
	public void setTurmas(List<Turma> turmas) {
		this.turmas = turmas;
	}
	
	@OneToMany(mappedBy = "professor")
	public List<Telefone> getTelefones() {
		return telefones;
	}

	public void setTelefones(List<Telefone> telefones) {
		this.telefones = telefones;
	}
	
	
	
	
}
